@extends('layouts.normal')
@section('self-style')
    <link rel="stylesheet" href="/package/plugins/datepicker/datepicker3.css">
    <link rel="stylesheet" href="/package/plugins/daterangepicker/daterangepicker-bs3.css">
    <style type="text/css">
        .form-group input[type="radio"] {margin-left: 20px;margin-right: 10px;}
        .form-group .radio-group {line-height: 34px;}
        .form-group .radio-group label {margin-bottom: 0px;}
    </style>
@endsection

@section('menu')
    @include("manager.layouts.menu")
@endsection

@section("header")
    <section class="content-header">
        <h4>
            合同管理
            <b>/</b>
            添加合同
        </h4>
    </section>
@endsection

@section('content')
    <section class="content">
        <div class="row">
            <div class="col-md-12">
                <!-- Horizontal Form -->
                <div class="box box-success">
                    <div class="form-horizontal">
                        <div class="box-header with-border">
                            <div class="col-sm-12">
                                <h3 class="col-sm-2 box-title"></h3>
                                <div class="col-sm-9">
                                    <a class="btn btn-default pull-right" href="javascript:history.back();">返回</a>
                                </div>
                            </div>
                        </div>
                        <!-- /.box-header -->
                        <!-- form start -->
                        <div class="box-body">
                            <div class="form-group">
                                <label class="col-sm-3 control-label">合同号:</label>
                                <div class="col-sm-8">
                                    <input type="text" class="form-control contract-sn">
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-3 control-label">合同模板:</label>
                                <div class="col-sm-8">
                                    <select class="form-control template-id"></select>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-3 control-label">合同承租人:</label>
                                <div class="col-sm-8">
                                    <input type="hidden" class="form-control contract-realname">
                                    <select class="form-control contract-user-id"></select>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-3 control-label">关联公寓:</label>

                                <div class="col-sm-8">
                                    <input type="hidden" class="form-control apart-name">
                                    <select class="form-control apart-id"></select>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-3 control-label">合同起止时间:</label>

                                <div class="col-sm-8">
                                    @include('layouts.start-end-time')
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-3 control-label"></label>
                                <div class="col-sm-8">
                                    <div class="input-group">
                                        <div class="input-group-addon">
                                            <i class="fa fa-calendar"></i>
                                        </div>
                                        <input type="hidden" class="form-control pull-right order-at" value="0000-00-00 00:00:00">
                                    </div>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-3 control-label">月租金:</label>

                                <div class="col-sm-8">
                                    <input type="text" class="form-control apart-rent">
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-3 control-label">是否续订:</label>

                                <div class="col-sm-8 radio-group">
                                    <label><input type="radio" name="is-renewable" value="1" />是</label>
                                    <label><input type="radio" name="is-renewable" value="0" checked="checked" />否</label>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-3 control-label">合同备注（选填）:</label>
                                <div class="col-sm-8">
                                    <textarea class="form-control contract-remark"></textarea>
                                </div>
                            </div>
                        </div>
                        <!-- /.box-body -->
                        <div class="box-footer">
                            <div class="form-group">
                                <label for="inputPassword3" class="col-sm-3 control-label"></label>

                                <div class="col-sm-8">
                                    <button class="btn btn-info pull-left btn-save">提交</button>
                                </div>
                            </div>

                        </div>
                        <!-- /.box-footer -->
                    </div>
                </div>
                <!-- /.box -->
            </div>
        </div>
    </section>
@endsection


@section('modal')

@endsection



@section('self-script')
    <script src="/package/plugins/datepicker/bootstrap-datepicker.js"></script>
    <script src="/package/plugins/datepicker/locales/bootstrap-datepicker.zh-CN.js"></script>
    <script src="/package/plugins/daterangepicker/moment.min.js"></script>
    <script src="/package/plugins/daterangepicker/daterangepicker.js"></script>
    <script type="text/javascript" src="/js/manager/contract-create.js?v={{ time() }}"></script>
@endsection
@section('local-script')
    <script type="text/javascript">
        $('.start-end-time').daterangepicker({
            "locale" : {
                "separator": " -222 ",
                "applyLabel": "确定",
                "cancelLabel": "取消",
                "fromLabel": "起始时间",
                "toLabel": "结束时间",
                "customRangeLabel": "自定义",
                "weekLabel": "W",
                "daysOfWeek": ["日", "一", "二", "三", "四", "五", "六"],
                "monthNames": ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"],
                "firstDay": 1
            },
            "format" : "YYYY-MM-DD",
            "separator" : " ~ "
        });
        $('.order-at').datepicker({
            "autoclose" : true,
            format: 'yyyy-mm-dd',
            "language" : "zh-CN"
        });
    </script>
@endsection